<!DOCTYPE html>
<html>

<head>
<title>修改代理</title>
<meta http-equiv="Pragma" CONTENT="no-cache">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="renderer" content="webkit">

<%include("/common/include.html"){}%>
<style type="text/css">
	.required{
		display:inline-block;
		width: 30%;
	}
	.requiredx{
		display:inline-block;
		width: 89%;
	}
	label{
		text-align:right;
		width:70px;
		display:inline-block;
	}
</style>
</head>

<body>
	<div class="easyui-panel" style="width: 100%; padding: 30px 60px; border-width: 0px;">
		<form id="upProduct" method="post" class="form">
				<div style="margin-bottom: 20px;">
					<input id = "thingsIds" type="hidden" name="propgandaThings.ids" value="${ids! }">
					<label class="label-top">产品编号:</label>
					<div class="required">
						<input name="propgandaThings.proBh" class="easyui-textbox theme-textbox-radius" style="width: 100%;" value="${propgandaThings.proBh! }">				
					</div>
					<span style="color:red">*必填项</span>
				</div>
				<div style="margin-bottom: 20px;">
					<label class="label-top">名称:</label>
					<div class="required">
						<input class="easyui-textbox theme-textbox-radius" style="width: 100%;" name="propgandaThings.name" value="${propgandaThings.name! }">
					</div>
					<span style="color:red">*必填项</span>
					<label class="label-top" style="margin-left:30px">单价:</label>
					<div class="required">
						<input id="price" class="easyui-numberbox theme-textbox-radius" precision="2" style="width: 100%;" name="propgandaThings.price" value="${propgandaThings.price! }" data-options="onChange:function(){total()}">
					</div>
					<span style="color:red">*必填项</span>
				</div>				
				<div style="margin-bottom: 20px">
					<label class="label-top">个数:</label>
					<div class="required">
						<input id="num" class="easyui-numberbox theme-textbox-radius" style="width: 100%;" name="propgandaThings.num" value="${propgandaThings.num! }" data-options="onChange:function(){total()}">
					</div>
					<span style="color:red">*必填项</span>
					<label class="label-top" style="margin-left:30px">总额:</label>
					<div class="required">
						<input id="total" class="easyui-numberbox theme-textbox-radius" precision="2" style="width: 100%;" name="propgandaThings.pricesum" value="${propgandaThings.pricesum! }">
					</div>
					<span style="color:red">*必填项</span>
				</div>
		</form>

	</div>
	
	<script type="text/javascript">
		
		//@ sourceURL=mmm.js
		var $form = $('#upProduct');

		var submitNow = function($dialog, $grid, $tree, $pjq) {
			
			
			var url = "${cxt!}/propgandaThings/upProduct";
			$.post(url, sy.serializeObject($form), function(result) {
				if (result.code == '200') {
					$grid.datagrid('reload');
					$.slideMsg("修改成功！", $pjq);
					$dialog.dialog('destroy');
				} else {
					$.alert($pjq, result.msg);
				}
			}, 'json');
		};
		var submitForm = function($dialog, $grid, $tree, $pjq) {
			submitNow($dialog, $grid, $tree, $pjq);
			// 					$form.isValid(function(isValied){
			// 						if(isValied){
			// 							submitNow($dialog, $grid, $pjq);
			// 						}
			// 					});
		};
		function total(){
			if($("#num").val() != "" && $("#price").val() != ""){
				var total=$("#num").val()*$("#price").val();
				$("#total").numberbox('setValue',total);
			}
		} 
	</script>
</body>
</html>